package StudyCode.summary.mycollection;

import java.util.Arrays;
import java.util.LinkedList;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class ViewingArraysAsListsAndConvertingListsToArrays {
	public static void main(String[] args) {
		String[] colors = {"black", "blue", "yellow"};
		LinkedList<String> links = new LinkedList<>(Arrays.asList(colors));

		links.addLast("red");
		links.add("pink");
		links.add(3, "green");
		links.addFirst("cyan");

		colors = links.toArray(new String[links.size()]);

		System.out.println("colors: ");

		for (String color : colors)
			System.out.println(color);
	}
}
